def count(data):
    # 循环统计每个元素出现的次数
    count_num = {}
    for i in data:
        if i not in count_num:
            count_num[i] = 1
        else:
            count_num[i] += 1
    return count_num


def read_file(file_path, encoding='utf-8'):
    with open(file=file_path, mode='r', encoding=encoding) as f:
        lines = f.readlines()

        # 去掉每一行后面的换行符
        new_lines = []
        for line in lines:
            new_lines.append(line.strip())

        return new_lines


# 定义保存文件的函数
def save_file(file_path, data, encoding='utf-8'):
    with open(file=file_path, mode='w', encoding=encoding) as f:
        for key, value in data.items():
            f.write(f"{key},{value}\n")


def sum(x, y):
    print("module2")
    s = x + y
    return s
